package basic

type student struct {
	id    uint16
	name  string
	age   uint8
	score uint8
}

var students []student

func newStudent(id uint16, name string, age, score uint8) *student {
	return &student{
		id:    id,
		name:  name,
		age:   age,
		score: score,
	}
}

func getStudents() []student {
	return students
}

func addStudent(student2 student) {
	students = append(students, student2)
}

func updateStudent(id uint16, student2 student) {
	for k, v := range students {
		if v.id == id {
			students[k] = student2
		}
	}
}

func delStudent(id uint16) {
	if len(students) > 0 {
		for k, v := range students {
			if v.id == id {
				students = append(students[:k], students[k+1:]...)
			}
		}
	}
}

func Object() {
	//fmt.Scanf()
}
